#!/usr/bin/python3
import json
import time
"""
阅读净化替换规则兼容，将旧id改为新式
"""
with open("replaceRule.json", "r", encoding='utf8') as f:
    jsonData = f.read()
obj = json.loads(jsonData)
for i in obj:
    if i['id'] < 1600000000000:
       i['id'] = int(round(time.time() * 1000))
       time.sleep(0.001)
data = json.dumps(obj, indent=2, ensure_ascii=False)
with open("replaceRule_.json", "w", encoding='utf8') as f:
    f.write(data)